<template>
  <main :class="['aud-show', {hide: $store.state.isHide}]">
    <header class="aud-show-head">
      <a href="">首页</a>
      &gt;&gt;
      <span>{{$store.state.audTitle}}</span>
    </header>
    <section class="aud-show-inner">
      <router-view></router-view>
    </section>
    <footer class="prog-ller">
      <section class="btn pre" title="该功能暂未开放">上一个</section>
      <section 
        class="btn sava-local"
        title="保存书签至本地，下次观看会有提示哦~"
        @click="savaSession($store.state.audTitle)"
      >存书签</section>
      <section class="btn next" title="该功能暂未开放">下一个</section>
    </footer>
  </main>
</template>

<script>
import { message } from 'ant-design-vue'
import moment from 'moment'
export default {
  name: 'AudShow',
  data() {
    return {
      
    }
  },
  methods: {
    savaSession(audTitle) {
      const aduMark = {
        // keyword: 'book mark233',
        title: audTitle,
        date: moment().format('YYYY年 MM月 DD日 HH:mm:ss')
      }
      localStorage.setItem('aduMark', JSON.stringify(aduMark))
      message.success('保存成功！')
    }
  },
}
</script>

<style lang="less" scoped>
.aud-show {
  width: 0;
  flex: auto;
  box-sizing: border-box;
  padding: 20px 10px;

  .aud-show-head {
    height: 40px;
    line-height: 40px;
    box-sizing: border-box;
    padding-left: 10px;
    color: rgb(166 168 173);

    a {
      color: #c5c6cb;

      &:hover {
        color: rgb(143,225,121);
      }
    }
  }

  .aud-show-inner {
    box-sizing: border-box;
    padding: 10px;
    background: rgba(228,244,186, .2);
  }

  .prog-ller {
    width: 600px;
    margin: auto;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;

    .btn {
      width: 140px;
      height: 40px;
      border: 1px solid rgb(187 180 180 / 80%);
      border-radius: 6px;
      text-align: center;
      line-height: 40px;
      cursor: pointer;

      &:hover {
        background-color: #d0f1d2;
      }
    }
  }
}
</style>